﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Xml;
using System.IO;


namespace Titler.ControlModels
{

    class PMControlModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        #region Control Fields
        private string _diameter;
        private string _weight;
        private string _thread;
        private string _profile;
        private string _material;
        private string _yield;
        private string _bypass;
        private string _flowmeter;
        private string _gaugefamily;
        private string _gaugediameter;
        private string _config;
        private string _gaugepressure;
        private string _gaugetemp;
        private string _gaugedtdr;
        private string _feedthru;
        private string _gaugeseal;
        private string _cvsize;
        private string _cvpressure;
        private string _cvburstdisk;
        private string _cvconfig; 
        #endregion

        #region Thread Control
        public string Diameter
        {
            get { return _diameter; }
            set
            {
                if (value != null && value != _diameter)
                {
                    _diameter = value;
                    RaisePropertyChanged("Diameter", value);
                }
            }
        }

        public string Weight
        {
            get { return _weight; }
            set
            {
                if (value != null && value != _weight)
                {
                    _weight = value;
                    RaisePropertyChanged("Weight", value);
                }
            }
        }

        public string Thread
        {
            get { return _thread; }
            set
            {
                if (value != null && value != _thread)
                {
                    _thread = value;
                    RaisePropertyChanged("Thread", value);
                }
            }
        }

        public string Profile
        {
            get { return _profile; }
            set
            {
                if (value != null && value != _profile)
                {
                    _profile = value;
                    RaisePropertyChanged("Profile", value);
                }
            }
        } 
        #endregion

        #region Material Control
        public string Material
        {
            get { return _material; }
            set
            {
                if (value != null && value != _material)
                {
                    _material = value;
                    RaisePropertyChanged("Material", value);
                }
            }
        }

        public string Yield
        {
            get { return _yield; }
            set
            {
                if (value != null && value != _yield)
                {
                    _yield = value;
                    RaisePropertyChanged("Yield", value);
                }
            }
        } 
        #endregion

        #region Mandrel Control
        public string Bypass
        {
            get { return _bypass; }
            set
            {
                if (value != null && value != _bypass)
                {
                    _bypass = value;
                    RaisePropertyChanged("Bypass", value);
                }
            }
        }

        public string Flowmeter
        {
            get { return _flowmeter; }
            set
            {
                if (value != null && value != _flowmeter)
                {
                    _flowmeter = value;
                    RaisePropertyChanged("Flowmeter", value);
                }
            }
        } 
        #endregion

        #region Gauge Control
        public string GaugeFamily
        {
            get { return _gaugefamily; }
            set
            {
                if (value != null && value != _gaugefamily)
                {
                    _gaugefamily = value;
                    RaisePropertyChanged("GaugeFamily", value);
                }
            }
        }

        public string GaugeDiameter
        {
            get { return _gaugediameter; }
            set
            {
                if (value != null && value != _gaugediameter)
                {
                    _gaugediameter = value;
                    RaisePropertyChanged("GaugeDiameter", value);
                }
            }
        }

        public string Config
        {
            get { return _config; }
            set
            {
                if (value != null && value != _config)
                {
                    _config = value;
                    RaisePropertyChanged("Config", value);
                }
            }
        }

        public string GaugePressure
        {
            get { return _gaugepressure; }
            set
            {
                if (value != null && value != _gaugepressure)
                {
                    _gaugepressure = value;
                    RaisePropertyChanged("GaugePressure", value);
                }
            }
        }

        public string GaugeTemp
        {
            get { return _gaugetemp; }
            set
            {
                if (value != null && value != _gaugetemp)
                {
                    _gaugetemp = value;
                    RaisePropertyChanged("GaugeTemp", value);
                }
            }
        }

        public string GaugeDTDR
        {
            get { return _gaugedtdr; }
            set
            {
                if (value != null && value != _gaugedtdr)
                {
                    _gaugedtdr = value;
                    RaisePropertyChanged("GaugeDTDR", value);
                }
            }
        }

        public string Feedthru
        {
            get { return _feedthru; }
            set
            {
                if (value != null && value != _feedthru)
                {
                    _feedthru = value;
                    RaisePropertyChanged("Feedthru", value);
                }
            }
        }

        public string GaugeSeal
        {
            get { return _gaugeseal; }
            set
            {
                if (value != null && value != _gaugeseal)
                {
                    _gaugeseal = value;
                    RaisePropertyChanged("GaugeSeal", value);
                }
            }
        } 
        #endregion

        #region Chemical Control
        public string CVSize
        {
            get { return _cvsize; }
            set
            {
                if (value != null && value != _cvsize)
                {
                    _cvsize = value;
                    RaisePropertyChanged("CVSize", value);
                }
            }
        }

        public string CVPressure
        {
            get { return _cvpressure; }
            set
            {
                if (value != null && value != _cvpressure)
                {
                    _cvpressure = value;
                    RaisePropertyChanged("CVPressure", value);
                }
            }
        }

        public string CVBurstDisk
        {
            get { return _cvburstdisk; }
            set
            {
                if (value != null && value != _cvburstdisk)
                {
                    _cvburstdisk = value;
                    RaisePropertyChanged("CVBurstDisk", value);
                }
            }
        }

        public string CVConfig
        {
            get { return _cvconfig; }
            set
            {
                if (value != null && value != _cvconfig)
                {
                    _cvconfig = value;
                    RaisePropertyChanged("CVConfig", value);
                }
            }
        } 
        #endregion


        /// <summary>
        /// Raise Property Changed Event
        /// </summary>
        /// <param name="propName"></param>
        /// <param name="propValue"></param>
        private void RaisePropertyChanged(string propName, string propValue)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propName));
        }

    }
   
}
